package du.myseckill.enums;

public enum SecKillStatEnum {
    SUCCESS(1,"秒杀成功"),
    END(0,"秒杀结束"),
    ONGOING(2,"秒杀进行中"),
    REPEAT_KILL(-1,"重复秒杀"),
    INNER_ERROR(-2,"系统异常"),
    DATA_REWRITE(-3,"数据篡改"),
    LOGOUT(-4,"当前用户已退出登录");
    private int stat;
    private String statInfo;

    SecKillStatEnum(int stat, String statInfo) {
        this.stat = stat;
        this.statInfo = statInfo;
    }
    public static SecKillStatEnum stateOf(int stat){
        for (SecKillStatEnum value : values()) {
            if(value.stat==stat)
                return value;
        }
        return null;
    }
    public int getStat() {
        return stat;
    }

    public String getStatInfo() {
        return statInfo;
    }

}
